package com.example.huainanlive.adapter

import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.huainanlive.R
import com.example.huainanlive.bean.GetCommentItem

class LiveChartAdapter: BaseQuickAdapter<GetCommentItem, BaseViewHolder>(R.layout.item_rv_chart) {
    override fun convert(holder: BaseViewHolder, item: GetCommentItem) {

        holder.getViewOrNull<TextView>(R.id.tv_chart_name)?.text = item.nickName
        holder.getViewOrNull<TextView>(R.id.tv_chart_time)?.text = item.createTime
        holder.getViewOrNull<TextView>(R.id.tv_chart_msg)?.text = item.msg

        holder.getViewOrNull<ImageView>(R.id.iv_chart_img)?.load(item.headImg)

    }
}